<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>冒泡排序</title>
	</head>
	<body>
	<script>
	<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>数组API</title>
	</head>
	<body>
		<script>
//			var s=[2,3,4,5,6,7,7,8];
//			console.log(s.length)
//			console.log(s[s.length-1])
//			s[10]="ni"
//			console.log(s)
//			console.log(s.toString().slice(','))
//			console.log(s.toString().split(','))
//          2数组的 for in循环
//         var fbb=[];
//         fbb['n1']="xx1";
//         fbb['n2']="xx2";
//         fbb['n3']="xx3";
//         fbb['n4']="xx4";
//         for (var key in fbb) {
//         	 console.log(key+":"+fbb[key])
//         }
//          3数组中寻找最大的值
			var s=[2,19,4,5,6,7,9,8];
			for (var y=0;y<s.length;y++) {
				for (var i=0;i<s.length-y;i++) {
				if(s[i]>s[i+1]){
					var c=s[i];
					s[i]=s[i+1];
					s[i+1]=c;
				}
				
			}
			}
			
			console.log(s)
			
			
			
  
		</script>
		
	</body>
</html>

	
	
	</script>
	</body>
</html>
